package com.tarena.lbs.activity.dao.repository.impl;

import com.tarena.lbs.activity.dao.mapper.ActivityMapper;
import com.tarena.lbs.activity.dao.repository.ActivityRepository;
import com.tarena.lbs.activity.pojo.po.ActivityPO;
import com.tarena.lbs.activity.pojo.query.ActivityQuery;
import com.tarena.lbs.activity.pojo.vo.ActivityVO;
import com.tarena.lbs.base.protocol.pager.BasePageQuery;
import com.tarena.lbs.base.protocol.pager.PageResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class ActivityRepositoryImpl implements ActivityRepository {

    @Autowired
    ActivityMapper activityMapper;

    /*
     * 查询活动列表
     * */
    @Override
    public List<ActivityVO> selectListByQuery(ActivityQuery query, int offset) {
        return activityMapper.selectListByQuery(query, offset);
    }

    @Override
    public int countByQuery(ActivityQuery query) {
        return activityMapper.countByQuery(query);
    }


    /*
     * 新增活动
     * */
   /* @Override
    public int insert(ActivityPO activityPO) {
        return activityMapper.insert(activityPO);
    }*/


    /*
     * 查询活动详情
     * */
    @Override
    public ActivityVO findById(Integer id) {
        return activityMapper.selectById(id);
    }


}
